This invention relates to efficient coding of data with an output block of fixed-length.
Data compression is an important aspect of data transmission and storage. Known compression methods allow data to occupy less bandwidth or storage space without data loss or with acceptable data loss. There are several methods of data compression, both lossless and lossy, among them Huffman coding, quantization, and direct cosine transformation. The particular application will normally determine the compression method used.
For broadcast of image data requiring high data rates, JPEG and MPEG are two well known and well accepted data compression methods. In general, data transmitted or stored in these formats are transformed, quantized, and then variable-length compressed to meet the system bandwidth or storage requirements. Compressed data blocks are not limited to be any particular length. When the end of a data block occurs, an end-of-block (EOB) code or flag is attached to the data to alert the system of the end of the current data block and of the beginning of another one.
However, there are instances where data, such as image data, must be stored or transmitted in fixed-length blocks. Known systems using variable-length compression methods ensure the data compression is sufficient to fit within the allocated space for each data block. It is not uncommon for the compression to use less space or bandwidth than is allocated. In this case, known systems place an EOB code leaving the remaining space alone, or pad the remaining space with zeros or some other expected bit pattern. Placing an EOB code or zero padding causes the system data throughput to stop while the remaining block space is handled, thus reducing system efficiency.
As the data rate increases to the limit of the system throughput, placing an EOB code or zero padding may cause data overflow in buffers resulting in data skipping. Similar problems may exist during decompression, stopping data throughput and creating the same unwanted result. Therefore, it is advantageous to implement a system which will produce fixed-length compressed data blocks with variable-length compression which will utilize the storage space or output bandwidth efficiently, without stopping data flow by placing an EOB or zero padding remaining block space.
In accordance with the principles of the present invention, a compression system creating fixed-length output data compresses input data with variable-length compression. The variable-length compression will, on occasion, compress an input data block with fewer bits than allocated in the fixed-length output block. In these instances, the compression system will recognize that there is remaining output space during compression and will zero pad selected compressed data words, causing the final compressed data block length to equal the allocated output block length.